<?php /* @var $this SubscriptionController */ ?>
<?php /* @var $model Subscription */ ?>
<?php Yii::app()->clientScript->registerCoreScript('jquery'); ?>
<div id="subscription-container">
    <?php $this->renderPartial('/subscription/_form', array(
        'model' => $model,
        'label' => 'Регистрирай се',
    )); ?>
</div>

<script type="text/javascript">
    $(document).ready(function(){
        var $form = $('#subscription-form');
        $form.submit(function(){
            var url = '<?php echo $this->createUrl('subscription/new'); ?>';
            $.post(url, $(this).serialize(), function(html){
                $('#subscription-container').html(html);
            });
            return false;
        });
    });
</script>
